package fic.storefinder.server.rpcservice;

import java.util.ArrayList;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

import fic.storefinder.client.service.RobeService;
import fic.storefinder.server.db.RobeTable;
import fic.storefinder.shared.serializable.POI;
import fic.storefinder.shared.serializable.Robe;

@SuppressWarnings("serial")
public class RobeServiceImpl extends RemoteServiceServlet implements RobeService {

	@Override
	public ArrayList<Robe> getRobeListForPOI(POI poi) throws Exception {
		RobeTable robeTable = new RobeTable();
		ArrayList<Robe> retValue = null;
		try {
			retValue = robeTable.getAllActiveRobeForPOI(poi);
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return retValue;
	}

	@Override
	public String updateRobe(Robe robe) throws Exception {
		try {
			RobeTable robeTable = new RobeTable();
			robeTable.updateRobe(robe);
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return null;
	}

	@Override
	public String insertRobe(Robe robe) throws Exception {
		try {
			RobeTable robeTable = new RobeTable();
			robeTable.insertRobe(robe);
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return null;
	}

	@Override
	public String deleteRobe(Robe robe) throws Exception {
		try {
			RobeTable robeTable = new RobeTable();
			robeTable.deleteRobe(robe);
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return null;
	}

}
